<template>
	<view class="content">
		<text style="font-size: 50rpx;">子组件A</text>
		<view class="coma_box">
			<text>父组件传进来的值：</text>
			<text style="font-weight: bold; color: red;">{{ intent }}</text>
		</view>
		<view>
			<button type="primary" @click="sendData">传值给CompB组件</button>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'comA',
		props: ['intent'],
		data() {
			return {

			}
		},
		methods: {
			sendData() {

				this.$emit('sendToCompB', this.intent)
			}
		}
	}
</script>

<style scoped>
	.content {
		padding: 20rpx;
		border: 2rpx solid #ccc;
		margin: 20rpx 0;
		border-radius: 10rpx;
	}

	.coma_box {
		margin: 20rpx 0;
	}

	button {
		margin-top: 20rpx;
	}
</style>